| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkGraphics::Entity Class Referencefinal

An entity in a render queue. It drives the shader and possible graph position for a set of renderables (SubEntity). More...

Inheritance diagram for nkGraphics::Entity:

## Public Member Functions
const EntityRenderInfo & | getRenderInfo () const
EntityRenderInfo & | getRenderInfo ()
Node * | getParentNode () const
RenderQueue * | getRenderQueue () const
void * | getUserData () const
void | setRenderInfo (const EntityRenderInfo &info)
void | setParentNode (Node *parent)
void | setDirtyNodeTransform (bool value)
void | setUserData (void *value)
void | updateMeshBinding (Mesh *oldMesh)
virtual void | exportClassToTree (nkExport::Node *rootNode) override
virtual void | importClassFromTree (nkExport::Node *rootNode) override
Public Member Functions inherited from nkExport::Exportable
| Exportable () noexcept
virtual | ~Exportable ()

## Detailed Description

An entity in a render queue. It drives the shader and possible graph position for a set of renderables (SubEntity).

It is possible to create one by calling RenderQueue::addEntity().
Adding it to a graph can be done by setting its parent node through setParentNode().

## Member Function Documentation

## ◆ getRenderInfo() [1/2]

const EntityRenderInfo& nkGraphics::Entity::getRenderInfo | ( |  | ) | const

Returns
  A const reference over the render information.

## ◆ getRenderInfo() [2/2]

EntityRenderInfo& nkGraphics::Entity::getRenderInfo | ( |  | ) |

Returns
  An editable reference over the render information.

## ◆ getParentNode()

Node* nkGraphics::Entity::getParentNode | ( |  | ) | const

Returns
  The parent node.

## ◆ getRenderQueue()

RenderQueue* nkGraphics::Entity::getRenderQueue | ( |  | ) | const

Returns
  The parent render queue.

## ◆ getUserData()

void* nkGraphics::Entity::getUserData | ( |  | ) | const

Returns
  The currently registered user data.

## ◆ setRenderInfo()

void nkGraphics::Entity::setRenderInfo | ( | const EntityRenderInfo & | info | ) |

Sets the render information the entity should use to be rendered during a pass.

Parameters

  info | The information to use.

## ◆ setParentNode()

void nkGraphics::Entity::setParentNode | ( | Node * | parent | ) |

Sets the parent node of the entity. This will impact the transformation applied to the entity when painting it. At all times, an entity can be attached to one node.

Parameters

  parent | The node to get a transformation from.

## ◆ setDirtyNodeTransform()

void nkGraphics::Entity::setDirtyNodeTransform | ( | bool | value | ) |

Invalidates the node transformation to recompute some internal states when required. Used internally.

Parameters

  value | Whether to dirtify or not.

## ◆ setUserData()

void nkGraphics::Entity::setUserData | ( | void * | value | ) |

Sets custom user data to link to the entity. Linking user data can be useful to help for custom instance shader slots implementation, for instance.

Parameters

  value | The user data to link to the entity.

## ◆ updateMeshBinding()

void nkGraphics::Entity::updateMeshBinding | ( | Mesh * | oldMesh | ) |

Updates the mesh bindings for a renderable sub entity. Used internally.

Parameters

  oldMesh | The old mesh that was set before.

## ◆ exportClassToTree()

virtual void nkGraphics::Entity::exportClassToTree | ( | nkExport::Node * | rootNode | ) |
| override virtual

Exports an item into a tree describing its structure and its data.

Parameters

  rootNode | The node into which the object has to write its related information.

Implements nkExport::Exportable.

## ◆ importClassFromTree()

virtual void nkGraphics::Entity::importClassFromTree | ( | nkExport::Node * | rootNode | ) |
| override virtual

Imports information from a tree which is supposed to describe its structure and data.

Parameters

  rootNode | The root node of the tree holding the information.

Implements nkExport::Exportable.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsGraphics/Entities/Entity.h